<template>
    <view style="display: inline-block;">
        <view class="call" @click.stop="callHandle"><u-icon name="phone-fill" size="30" color="#2eb0d9"></u-icon></view>
    </view>
</template>

<script>
export default {
    props: {
        phoneNumber: {
            type: String,
            default: ''
        }
    },
    data() {
        return {

        }
    },
    onLoad(opt) {
        if (opt.uid) {
            this.uid = opt.uid
        }
    },
    onShow() {

    },
    methods: {
        callHandle() {
            if (this.phoneNumber) {
                uni.makePhoneCall({
                    phoneNumber: this.phoneNumber, // 这里填入你要拨打的电话号码
                });
            } else {
                uni.showToast({
                    title: '暂无电话号码',
                    icon: 'none'
                })
            }

        }
    }
}
</script>

<style lang="scss" scoped>
.call {
    padding: 10rpx;
    color: #2eb0d9;
    width: 50rpx;
    margin-left: 15rpx;
}
</style>